3.221 \(\int (B \cos (c+d x)+C \cos ^2(c+d x)) \sec ^2(c+d x) \, dx\)

Optimal. Leaf size=16 \[ \frac {B \tanh ^{-1}(\sin (c+d x))}{d}+C x \]

[Out]

C*x+B*arctanh(sin(d*x+c))/d

________________________________________________________________________________________

Rubi [A]  time = 0.05, antiderivative size = 16, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.107, Rules used = {3010, 2735, 3770} \[ \frac {B \tanh ^{-1}(\sin (c+d x))}{d}+C x \]

Antiderivative was successfully verified.

[In]

Int[(B*Cos[c + d*x] + C*Cos[c + d*x]^2)*Sec[c + d*x]^2,x]

[Out]

C*x + (B*ArcTanh[Sin[c + d*x]])/d

Rule 2735

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(b*x)/d
, x] - Dist[(b*c - a*d)/d, Int[1/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d
, 0]

Rule 3010

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x
_Symbol] :> Dist[1/b, Int[(b*Sin[e + f*x])^(m + 1)*(B + C*Sin[e + f*x]), x], x] /; FreeQ[{b, e, f, B, C, m}, x
]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin {align*} \int \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^2(c+d x) \, dx &=\int (B+C \cos (c+d x)) \sec (c+d x) \, dx\\ &=C x+B \int \sec (c+d x) \, dx\\ &=C x+\frac {B \tanh ^{-1}(\sin (c+d x))}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 16, normalized size = 1.00 \[ \frac {B \tanh ^{-1}(\sin (c+d x))}{d}+C x \]

Antiderivative was successfully verified.

[In]

Integrate[(B*Cos[c + d*x] + C*Cos[c + d*x]^2)*Sec[c + d*x]^2,x]

[Out]

C*x + (B*ArcTanh[Sin[c + d*x]])/d

________________________________________________________________________________________

fricas [B]  time = 0.65, size = 36, normalized size = 2.25 \[ \frac {2 \, C d x + B \log \left (\sin \left (d x + c\right ) + 1\right ) - B \log \left (-\sin \left (d x + c\right ) + 1\right )}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^2,x, algorithm="fricas")

[Out]

1/2*(2*C*d*x + B*log(sin(d*x + c) + 1) - B*log(-sin(d*x + c) + 1))/d

________________________________________________________________________________________

giac [B]  time = 0.63, size = 43, normalized size = 2.69 \[ \frac {{\left (d x + c\right )} C + B \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - B \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^2,x, algorithm="giac")

[Out]

((d*x + c)*C + B*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - B*log(abs(tan(1/2*d*x + 1/2*c) - 1)))/d

________________________________________________________________________________________

maple [A]  time = 0.15, size = 30, normalized size = 1.88 \[ C x +\frac {B \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {C c}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^2,x)

[Out]

C*x+1/d*B*ln(sec(d*x+c)+tan(d*x+c))+1/d*C*c

________________________________________________________________________________________

maxima [B]  time = 0.56, size = 37, normalized size = 2.31 \[ \frac {2 \, {\left (d x + c\right )} C + B {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )}}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^2,x, algorithm="maxima")

[Out]

1/2*(2*(d*x + c)*C + B*(log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1)))/d

________________________________________________________________________________________

mupad [B]  time = 1.03, size = 57, normalized size = 3.56 \[ \frac {2\,B\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {2\,C\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((B*cos(c + d*x) + C*cos(c + d*x)^2)/cos(c + d*x)^2,x)

[Out]

(2*B*atanh(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (2*C*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (B + C \cos {\left (c + d x \right )}\right ) \cos {\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*cos(d*x+c)+C*cos(d*x+c)**2)*sec(d*x+c)**2,x)

[Out]

Integral((B + C*cos(c + d*x))*cos(c + d*x)*sec(c + d*x)**2, x)

________________________________________________________________________________________